package com.fqgj.xjd.user.integration.ocr.adapter;

import com.alibaba.fastjson.annotation.JSONField;
import com.fqgj.xjd.user.client.response.AddressSplit;
import com.fqgj.xjd.user.client.response.OcrPassportBack;
import com.fqgj.xjd.user.client.response.OcrVoteridBack;
import com.fqgj.xjd.user.integration.ocr.adapter.basic.BasicAdapter;
import com.fqgj.xjd.user.integration.ocr.adapter.basic.BasicAdapterAddressBean;
import com.fqgj.xjd.user.integration.ocr.adapter.basic.BasicAdapterBean;

/**
 * ·
 *
 * @author liuming
 * Created on 上午11:44 2019/1/3.
 */
public class PassportBackAdapter extends BasicAdapter<OcrPassportBack> {

    @JSONField(name = "old_passport_num")
    private BasicAdapterBean oldPassportNum;

    @JSONField(name = "passport_num")
    private BasicAdapterBean passportNum;

    @JSONField(name = "pin")
    private BasicAdapterBean pin;

    @JSONField(name = "old_place_of_issue")
    private BasicAdapterBean oldPlaceOfIssue;

    @JSONField(name = "father")
    private BasicAdapterBean father;

    @JSONField(name = "old_doi")
    private BasicAdapterBean oldDoi;

    @JSONField(name = "mother")
    private BasicAdapterBean mother;

    @JSONField(name = "spouse")
    private BasicAdapterBean spouse;

    @JSONField(name = "file_num")
    private BasicAdapterBean fileNum;

    @JSONField(name = "address")
    private BasicAdapterAddressBean address;

    public BasicAdapterAddressBean getAddress() {
        return address;
    }

    public PassportBackAdapter setAddress(BasicAdapterAddressBean address) {
        this.address = address;
        return this;
    }

    public BasicAdapterBean getOldPassportNum() {
        return oldPassportNum;
    }

    public PassportBackAdapter setOldPassportNum(BasicAdapterBean oldPassportNum) {
        this.oldPassportNum = oldPassportNum;
        return this;
    }

    public BasicAdapterBean getPassportNum() {
        return passportNum;
    }

    public PassportBackAdapter setPassportNum(BasicAdapterBean passportNum) {
        this.passportNum = passportNum;
        return this;
    }

    public BasicAdapterBean getPin() {
        return pin;
    }

    public PassportBackAdapter setPin(BasicAdapterBean pin) {
        this.pin = pin;
        return this;
    }

    public BasicAdapterBean getOldPlaceOfIssue() {
        return oldPlaceOfIssue;
    }

    public PassportBackAdapter setOldPlaceOfIssue(BasicAdapterBean oldPlaceOfIssue) {
        this.oldPlaceOfIssue = oldPlaceOfIssue;
        return this;
    }

    public BasicAdapterBean getFather() {
        return father;
    }

    public PassportBackAdapter setFather(BasicAdapterBean father) {
        this.father = father;
        return this;
    }

    public BasicAdapterBean getOldDoi() {
        return oldDoi;
    }

    public PassportBackAdapter setOldDoi(BasicAdapterBean oldDoi) {
        this.oldDoi = oldDoi;
        return this;
    }

    public BasicAdapterBean getMother() {
        return mother;
    }

    public PassportBackAdapter setMother(BasicAdapterBean mother) {
        this.mother = mother;
        return this;
    }

    public BasicAdapterBean getSpouse() {
        return spouse;
    }

    public PassportBackAdapter setSpouse(BasicAdapterBean spouse) {
        this.spouse = spouse;
        return this;
    }

    public BasicAdapterBean getFileNum() {
        return fileNum;
    }

    public PassportBackAdapter setFileNum(BasicAdapterBean fileNum) {
        this.fileNum = fileNum;
        return this;
    }

    @Override
    public OcrPassportBack doAdapter() {
        OcrPassportBack ocrPassportBack = new OcrPassportBack();
        ocrPassportBack.setSpouse(this.spouse.getValue());
        ocrPassportBack.setPin(this.pin.getValue());
        ocrPassportBack.setOldPlaceOfIssue(this.oldPlaceOfIssue.getValue());
        ocrPassportBack.setOldPassportNum(this.oldPassportNum.getValue());
        ocrPassportBack.setOldDoi(this.oldDoi.getValue());
        ocrPassportBack.setMother(this.mother.getValue());
        ocrPassportBack.setFileNum(this.fileNum.getValue());
        ocrPassportBack.setFather(this.father.getValue());
        ocrPassportBack.setAddress(this.address.getValue());
        AddressSplit addressSplit = new AddressSplit();
        addressSplit.setCity(this.address.getCity());
        addressSplit.setLine1(this.address.getLine1());
        addressSplit.setLine2(this.address.getLine2());
        addressSplit.setPin(this.address.getPin());
        addressSplit.setState(this.address.getState());
        ocrPassportBack.setAddressSplit(addressSplit);
        return ocrPassportBack;
    }
}
